#@adminLayout()
#define main()
  <main class="app-content">
    <div class="app-title">
      <div>
        <h1><i class="fa fa-th-list"></i>用户管理</h1>
        <p>网站用户信息管理</p>
      </div>
      <ul class="app-breadcrumb breadcrumb">
        <li class="breadcrumb-item"><a href="/admin"><i class="fa fa-home fa-lg"></i>仪表盘</a></li>
        <li class="breadcrumb-item active"><a href="/admin/user">用户管理</a></li>
      </ul>
    </div>

    <div class="row">
      <div class="clearfix"></div>
      <div class="col-md-12">
        <div class="tile">
          <div class="table-responsive">
            <table class="table table-bordered">
              <thead>
                <tr>
                  <th>昵称</th>
                  <th>邮箱</th>
                  <th>锁定</th>
                  <th>威望</th>
                  <th>积分</th>
                  <th>是否认定</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              #for(x : userPage.getList())
                <tr>
                  <td>#(x.nickName)</td>
                  <td>#(x.email)</td>
                  <td>
                  	#if(x.isStatusReg())
						未激活
					#else
	                    <div class="toggle lg"><label>
	                    	<input data-id="#(x.uid)" type="checkbox" 
	                    	#if(x.isStatusReg()) disabled #end
	                    	#if(x.isStatusLockId()) checked #end
	                    	class="mgc-switch mgc-tiny" ><span class="button-indecator"></span></label>
	                    </div>
	                #end
                  </td>
                  <td>#(x.prestige)</td>
                  <td>#(x.points)</td>
                  <td>
					#if(x.isAuthOk()) <button class="btn btn-info btn-sm" type="button" disabled="">ON</button> 
                   	#elseif(x.isAuthNo()) <button class="btn btn-secondary btn-sm" type="button" disabled="">OFF</button>
                   	#elseif(x.isAuthFa()) <button class="btn btn-danger btn-sm" type="button" disabled="">审核</button> #end
                  </td>
                  <td>
                    <a class="btn btn-info btn-sm" href="/admin/user/userEdit?id=#(x.uid)&p=#(userPage.pageNumber)" title="修改"><i class="fa fa-lg fa-edit">修改</i></a>
                    <a class="btn btn-warning btn-sm" href="/user/detail/#(x.uid)" target="_blank" title="查看"><i class="fa fa-lg fa-eye">查看</i></a>
                    <a class="btn btn-success btn-sm" href="/admin/user/assignRoles?id=#(x.uid)" title="分配角色"><i class="fa fa-lg fa-cog">权限</i></a>
                  </td>
                </tr>
                #end
              </tbody>
            </table>
            <div>
               #@adminPaginate(userPage.pageNumber, userPage.totalPage, "/admin/user?p=") 
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>
#end

#define js()
<script type="text/javascript">
	$(document).ready(function() {
		initMagicInput(prepareAction);
	});

	function prepareAction($this, state) {
		return {
			url: state ? "/admin/user/lock" : "/admin/user/unlock",
			data : {
				id: $this.attr("data-id")
			}
		}
	}
</script>
#end